home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 574 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.mindlink.net!news
  2. From: genew@mindlink.bc.ca (Gene Wirchenko)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Is this ok: *pointer++ = value ??
  5. Date: Sun, 07 Jan 1996 01:51:54 GMT
  6. Organization: MIND LINK! - British Columbia, Canada
  7. Message-ID: <4cn97v$6on@fountain.mindlink.net>
  8. References: <4cklvv$nmm@alcor.usc.edu> <4cmmcd$e3u@gryphon.phoenix.net> <30eefb76.72646976@nntp.ix.netcom.com>
  9. NNTP-Posting-Host: line139.nwm.mindlink.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. miker3@ix.netcom.com (Mike Rubenstein) wrote:
  13.  
  14. >brucew@phoenix.net (Bruce Wedding) wrote:
  15.  
  16. >|>wawda@alcor.usc.edu (Abu Wawda) wrote:
  17. >|>
  18. >|>>    for (i=0; i<50; i++) *pointer++ = i;
  19. >|>
  20. >|>>My only problem is why? I mean you aren't allowed to do:
  21. >|>
  22. >|>>                 for (i=0; i<50; i++) p++ = i;
  23. >|>
  24. >|>Sure you can do that.  You are assigning addresses to the pointer.
  25. >It
  26. >|>probably isn't too smart, but it is legal.
  27.  
  28. >In what language is it legal?  Certainly not C which requires a
  29. >modifiable lvalue as the right operand of = and defines p++ as not
  30. >being an lvalue.
  31.  
  32. >Michael M Rubenstein
  33.  
  34.      Bull!  The RIGHT operand requires an L-value?  Ha!  That would
  35. make:
  36.           int a;
  37.           a=2;
  38. illegal.
  39.      In the example above,
  40.           p
  41. is the L-value.  After being used as such, it is incremented.
  42.  
  43. Sincerely,
  44.  
  45. Gene Wirchenko
  46.  
  47. C Pronunciation Guide:
  48.      y=x++;     "wye equals ex plus plus semicolon"
  49.      x=x++;     "ex equals ex doublecross semicolon"
  50.  
  51.